I got this following error while running django project "ProgrammingError at /admin/ Table 'django_session' doesn't exist".
SOLUTION:
This error you will get, when you're not migrated the django model.
CODE:
import datetime from django.db import models import os from django.db import models def getFileName(request,filename): now_time=datetime.datetime.now().strftime("%Y%m%d%H:%M:%S") new_filename="%s%s"%(now_time,filename) return os.path.join('uploads/', new_filename) class Category(models.Model): name=models.CharField(max_length=150,null=False,blank=False) image=models.ImageField(upload_to=getFileName,null=True,blank=True) description=models.TextField(max_length=500,null=False,blank=False) status=models.BooleanField(default=False,help_text="0-Show,1-Hidden") created_at=models.DateTimeField(auto_now_add=True) def __str__(self): return self.name
python manage.py makemigrations
python manage.py migrate
After completing migrations create super user
python manage.py createsuperuser
SOLUTION:
pip install matplotlib
VIDEO GUIDE:
Post your comments / questions
Recent Article
- How to create custom 404 error page in Django?
- Requested setting INSTALLED_APPS, but settings are not configured. You must either define..
- ValueError:All arrays must be of the same length - Python
- Check hostname requires server hostname - SOLVED
- How to restrict access to the page Access only for logged user in Django
- Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default
- Add or change a related_name argument to the definition for 'auth.User.groups' or 'DriverUser.groups'. -Django ERROR
- Addition of two numbers in django python
Related Article